#ifndef DIRECTOR_H
#define DIRECTOR_H
#include <QList>
#include <QVariant>
#include "Actor.hpp"
#include <QTime>
#include "Timer.hpp"

class QSettings;
class Scene;
/**
  \short our eyes and ears, the director is a singleton that controls everything.
  */
class Director : public Actor
{
    Q_OBJECT;
public:
    static Director *instance();

public slots:
    void update(float);
    void action(); // for compatibility
    float getTime() { return time.absolute(); }

    QVariant  getSetting(const QByteArray &key) const;
protected:
    Director(Actor *parent=0);
private:
    void generateConfig();
    QList<Actor*> cast;
    Timer time;
    float counter;
    Scene *currentScene;
    QSettings *set;
    QVariant nullSetting;
};
#define GETV(x) Director::instance()->getSetting(x)
#define SETV(x) Director::instance()->setSetting(x)
#endif // DIRECTOR_H
